﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ks.aspx.cs" Inherits="Maticsoft.Web.ks" MaintainScrollPositionOnPostBack="true" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>中共聊城市高唐纪委业务知识考试系统</title>
    <%--<link href="admin/JS/easyui/themes/default/easyui.css" rel="stylesheet" />
    <link href="admin/JS/easyui/themes/icon.css" rel="stylesheet" />--%>
    <%--<link href="css/style.css" rel="stylesheet" type="text/css" />--%>
    <script src="admin/JS/easyui/jquery.min.js"></script>
   <%-- <script src="admin/JS/easyui/jquery.easyui.min.js"></script>--%>
    <script src="js/jquery.cookie.js"></script>
    <link rel="stylesheet" type="text/css" href="Content/infomng-140422.css" />
    <link href="css/css.css" rel="stylesheet" />
    <link href="css/style.css" rel="stylesheet" />
    <script type="text/javascript">
        var _t;         
        var time = $.cookie('time');
        var _h = <%= tt[0] %>;
        var _m = <%= tt[1] %>;
        var _s = <%= tt[2] %>;
        var _v = formatTime(_h + ':' + _m + ':' + _s);
        if(time!=null){ 
            //maxtime = 1*60;
            if(!isNaN(time.split(":")[0]))
            {
                _v=time;
                _h=_v.split(":")[0];
                _m=_v.split(":")[1];
                _s=_v.split(":")[2];
            }
        }      
        function doTime() {
            _s--;
            if (_s == -1) {
                _m--;
                _s = 59;
            }
            if (_m == -1) {
                _h--;
                _m = 59;
            }
            var _b = ((_h == 0) && (_m == 0) && (_s == 0));
            
            if (_b) {
                _v = '00:00:00';
                clearTimeout(_t);                
                document.getElementById("btnjj").click();
                $.cookie('time',null);
                return;

            } else {
                _v = formatTime(_h + ':' + _m + ':' + _s);
                _t = setTimeout('doTime()', 1000);
            }
            document.all['t'].innerHTML = "距考试结束还有:" + _v;
            document.all['<%=this.hftime.ClientID %>'].value=_v;
            $.cookie('time',_v);
            var _save=((_m %5== 0) && (_s == 0));
            if(_save)
            {
                document.getElementById("Button2").click();
            }
        }
        function clickcheck() {
            document.getElementById("plTest").style.display = "none";
            document.getElementById("plCheck").style.display = "";
        }
        function ccookie()
        {
            $.cookie('time',null);
        }
        function clickBack() {
            document.getElementById("plTest").style.display = "";
            document.getElementById("plCheck").style.display = "none";
        }
        function numberClicked(sNumber) {
            document.getElementById("plTest").style.display = "";
            document.getElementById("plCheck").style.display = "none";

            var _s = window.location.href;
            _s = _s.replace(/#.*$/g, "");
            sNumber = parseInt(sNumber);
            window.location.href = _s + "#q" + sNumber;

            //            var divs = document.getElementsByName("divQuestion");
            //            divs[sNumber].focus();
        }
        function changeColor(obj, tbObjId) {
            var tbObj = document.getElementById(tbObjId);
            if (obj.className == "bjst2") {
                tbObj.value = tbObj.value.replace("M", "");
                //tbObj.parentNode.style.backgroundColor="";
                obj.className = "bjst";
                obj.value = "标记";
            } else {
                tbObj.value = "M" + tbObj.value;
                //tbObj.parentNode.style.backgroundColor="#F7EEA6";
                obj.className = "bjst2";
                obj.value = "取消标记";
            }
            return false;
        }
        function formatTime(_time) {
            return _time.replace(/\b(\w)\b/g, '0$1');
        }
        function checkremark() {
            $("input[name$='hfmark'][value^='M']").each(function () {
                $(this).next().attr('class', 'bjst2').val('取消标记');
            });
        }
        var advInitTop = 0;
        var closeInitTop = 0;
        function inix() {
            document.all['t'].innerHTML = "距考试结束还有:" + _v;
            _t = setTimeout('doTime()', 1000);
            //advInitTop = document.getElementById("oTime").style.pixelTop;

        }       
        function checkremark() {
            $("input[name$='hfmark'][value^='M']").each(function () {
                $(this).next().attr('class', 'bjst2').val('取消标记');
            });
        }
        function checks()
        {
            var s="",m="",j="";
            var snums=$('#<%= this.lblssum.ClientID%>').text();
             var mnums=$('#<%= this.lblmsum.ClientID%>').text();
             var jnums=$('#<%= this.lbljsum.ClientID%>').text();
             var sid="",mid="",jid="";
             for(i=0;i<snums;i++)
             {
                 id=".s"+i+1+" :radio";
                 if($(id).filter(':checked').length<1)
                     s+="第"+(i+1)+"题";
             }
             for(i=0;i<mnums;i++)
             {
                 id=".m"+i+1+" :checkbox";
                 if($(id).filter(':checked').length<1)
                     m+="第"+(i+1)+"题";
             }
             for(i=0;i<jnums;i++)
             {
                 id=".j"+i+1+" :radio";
                 if($(id).filter(':checked').length<1)
                     j+="第"+(i+1)+"题";
             }
             if(s!="")
             {
                 s="单选题："+s;
                 s=s+"\n";
             }
             if(m!="")
             {
                 m="多选题："+m;
                 m=m+"\n";
             }
             if(j!="")
             {
                 j="判断题："+j;
                 j=j+"\n";
             }
             if(s!=""||m!=""||j!="")
             {
                 if (confirm('以下的题还没有做：\n' + s + m + j+'\n您真的要交卷吗？'))
                     return true;
                 else
                     return false;
             }
             else
             {return true;}
         }   
         function validateSubmit() {
             if (confirm("您确认提交答卷吗？")) {
                 if (confirm("请再次确认，您提交答卷吗？")) {
                     $.cookie("time",null);
                     return true;
                 }
             }
             return false;
         }
         $(function () { 
             var elm = $('#oTime'); 
             var startPos = $(elm).offset().top; 
             $.event.add(window, "scroll", function () { 
                 var p = $(window).scrollTop(); 
                 $('#hfscroll').val(p);
                 //$(elm).css('position', ((p) > startPos) ? 'fixed' : 'absolute'); 
                 $(elm).css('position', ((p) > startPos) ? 'fixed' : 'static');
                 $(elm).css('top', ((p) > startPos) ? '0px' : '');
             });
             $(window).scrollTop($('#hfscroll').val());
             checkremark();            
             $(".mtihao").each(function () {
                 var id = $(this).text();
                 var newid = parseInt(id) + parseInt($("#lblssum").text());
                 $(this).text(newid);
             });
             $(".jtihao").each(function () {
                 var id = $(this).text();
                 var newid = parseInt(id) + parseInt($("#lblssum").text()) + parseInt($("#lblmsum").text());
                 $(this).text(newid);
             });
             $(".atihao").each(function () {
                 var id = $(this).text();
                 var newid = parseInt(id) + parseInt($("#lblssum").text()) + parseInt($("#lblmsum").text()) + parseInt($("#lbljsum").text());
                 $(this).text(newid);
             });
             //mjump

             $(".mjump").each(function () {
                 var id = $(this).attr("name");
                 id = id.substr(1, id.length - 1);
                 var newid = parseInt(id) + parseInt($("#lblssum").text());
                 $(this).attr("name", "q" + newid);
             });
             $(".jjump").each(function () {
                 var id = $(this).attr("name");
                 id = id.substr(1, id.length - 1);
                 var newid = parseInt(id) + parseInt($("#lblssum").text()) + parseInt($("#lblmsum").text());
                 $(this).attr("name", "q" + newid);
             });
         });        

    </script>

    <style type="text/css">
        .imgCss
        {
        	vertical-align:bottom;
        	}
        html,body {
         width:100%;
         /*background-color:white;*/
        }
        .style1 {
            width: 100%;
        }

        .style2 {
            font-size: 13px;
            font-weight: bold;
            color: #0000FF;
        }

        .topM {
            margin-top: 18px;
            text-align: left;
        }

        .style3 {
            margin-left:5px;
            font-size: 14px;
            line-height:28px;
            float:left;
        }
        #btnOK {
        width:80px;
        height:24px;
        }
    </style>
</head>
<body onload="inix()">

    <form id="form1" runat="server">
          <div class="head" style="width:990px; margin:0 auto;">
        <div id="head_logotext">
            <span style=" font-size:33px; font-weight:bold; color:White; font-family:隶书; line-height:36px;"><span 
                lang="EN-US"></span><span>在线考试系统</span></span></div>
        <div id="head_right">
            <div class="head_rtop">
                <asp:Label ID="lbl_welcome" runat="server"></asp:Label></div>
           <%-- <div class="head_rbottom">
                <ul>
                    <li><a href="UpdatePass.aspx" target="frightBottom">修改密码</a></li>
                    <li><asp:LinkButton ID="lbn_exit" runat="server" onclick="lbn_exit_Click">退出系统</asp:LinkButton></li>
                </ul>
            </div>--%>
        </div>
    </div>
        <div id="oTime"  runat="server" style="width:100%;">
            <div id="mytime" style="padding:5px;width:980px; margin:0 auto;">
                <div style="width:500px;margin:0 auto;">
            <img src="Images/i-zb.gif" style="float:left" /> <div id="t" style="color: Red;float:left; font-weight: bold; font-size: 18px;line-height:28px;" ></div>
            <strong><span class="style3">5分钟系统自动保存</span></strong> <asp:Button ID="Button2" runat="server" OnClick="btn_submit_Click" style="margin:5px;" Text=" 点击保存 " />
                    </div>
                </div>
        </div>
        <div id="plTest" style="background-color: white; width:990px; margin:0 auto;">
                    <asp:Panel ID="pfen" runat="server" Visible="false">
                    <div align="center" style="margin: 10px;">
                        
                        <asp:Label ID="lbWarnResult" runat="server" Text="Label" CssClass="warnInfo"></asp:Label>
                    </div></asp:Panel>
                    <div class="noteArea">
                            第一部分：<span id="lbType1">单项选择题</span> （共<asp:Label ID="lblssum" runat="server"></asp:Label>
                            道题，每题<asp:Label ID="lblsfen" runat="server"></asp:Label>
                            分）</div>
                        <asp:DataList ID="DataList1" runat="server" CssClass="topM" OnItemDataBound="DataList1_ItemDataBound">
                    <ItemTemplate>
                            <div class="questionArea" name="divQuestion">
                                <a name="q<%#Container.ItemIndex + 1 %>"></a><span id="rpt1_ctl00_lbContent">
                                    <table>
                                        <tbody>
                                            <tr>
                                                    <td class="cTiHao">
                                                        <%#Container.ItemIndex + 1 %>、
                                                    </td>
                                        <td class="cTi">
                                            <div class="3DSection1">
                                                            <asp:Label ID="Label7" runat="server" Text='<%# Bind("stitle") %>'></asp:Label><br /><br />
                                                            <asp:Label ID="Label1" runat="server" Text='<%#  "A："+ Eval("sA") %>'></asp:Label><br /><br />
                                                            <asp:Label ID="Label5" runat="server" Text='<%#  "B："+ Eval("sB") %>'></asp:Label><br /><br />
                                                            <asp:Label ID="Label4" runat="server" Text='<%#  "C："+ Eval("sC") %>'></asp:Label><br /><br />
                                                            <asp:Label ID="Label3" runat="server" Text='<%#  "D："+ Eval("sD") %>'></asp:Label><br /><br />
                                                <asp:Label ID="lbl_singleId" runat="server" Text='<%# Bind("singleId") %>'
                                            Visible="False"></asp:Label>
                                            </div>
                                        </td>
                                        </tr>
                                           </tbody>
                                    </table>
</span>                                
                                <asp:Panel ID="Pd" runat="server">
                                    <div class="noteArea2">
                                    <table border="0" cellspacing="0" cellpadding="0">
                                                <tbody>
                                                    <tr>
                                            <td style="padding-left: 5px;">
                                                <b>选择答案：</b>
                                            </td>
                                            <td width="300">
                                                <div class="resultArea">
                                                                <table border="0" cellpadding="5">
                                                                    <tbody>
                                                                        <tr>
                                                                            <td class='<%# "s"+ Container.ItemIndex + 1  %>'>
                                                                                <asp:RadioButton ID="rdoA" runat="server" GroupName="rdo" Text="A" />
                                                                                <asp:RadioButton ID="rdoB" runat="server" Text="B" GroupName="rdo" />
                                                                                <asp:RadioButton ID="rdoC" runat="server" Text="C" GroupName="rdo" />
                                                                                <asp:RadioButton ID="rdoD" runat="server" Text="D" GroupName="rdo" />
			</td>
		</tr>
                                                                    </tbody>
                                                                </table>
                                                </div>
                                            </td>
                                            <td align="left">
                                                <div class="bjArea">
                                                    <asp:HiddenField ID="hfmark" runat="server" Value='<%# Container.ItemIndex + 1  %>' />
                                                    <asp:Button ID="btnMark" runat="server" Text="标  记" CssClass="bjst" />
                                                </div>
                                            </td>
                                        </tr>
                                                </tbody>
                                            </table>
                                </div>
                                </asp:Panel>
                            </div>                    
                    </ItemTemplate>
                </asp:DataList>
                    <div class="noteArea">
                            第二部分：<span id="lbType2">多项选择题</span> （共<span id="lbTotal2"><asp:Label ID="lblmsum" runat="server"></asp:Label></span>道题，每题<span id="lbFs2"><asp:Label ID="lblmfen" runat="server"></asp:Label></span>分）

                    </div>
                        <asp:DataList ID="DataList2" runat="server" CssClass="topM" 
                        OnItemDataBound="DataList2_ItemDataBound">
                    <ItemTemplate>
                        <div class="questionArea" id="divQuestion">
                                <a name="q<%#Container.ItemIndex + 1 %>" class="mjump"></a><span id="rpt2_ctl00_lbContent">
                                    <table>
                                        <tbody>
                                            <tr>
                                                    <td class="cTiHao">
                                                        <span class="mtihao"><%#Container.ItemIndex + 1 %></span>、
                                                    </td>
                                                <td class="cTi">
                                    <div class="3DSection1">
                                                            <asp:Label ID="Label3" runat="server" Text='<%# Bind("mtitle") %>'></asp:Label>
                                                            <asp:Label ID="lbl_mostId" runat="server" Text='<%# Bind("mostId") %>' Visible="False"></asp:Label><br /><br />
                                            <asp:Label ID="Label2" runat="server" Text='<%#  "A："+ Eval("mA") %>'></asp:Label>
                                            <br />
                                            <br />
                                            <asp:Label ID="Label4" runat="server" Text='<%#  "B："+ Eval("mB") %>'></asp:Label>
                                            <br />
                                            <br />
                                            <asp:Label ID="Label5" runat="server" Text='<%# "C："+ Eval("mC") %>'></asp:Label>
                                            <br />
                                            <br />
                                            <asp:Label ID="Label6" runat="server" Text='<%# "D："+ Eval("mD") %>'></asp:Label>
                                            <br />
                                            <br />
                                        
                                    </div>
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                    </span>                           
                                <asp:Panel ID="Pd" runat="server">
                                <div class="noteArea2">
                                    <div class="markArea" style="display: none;">
                                    </div>
                                    <table>
                                                <tbody>
                                                    <tr>
                                            <td>
                                                <b>选择答案：</b>
                                            </td>
                                            <td width="300">
                                                <div class="resultArea">
                                                                <table id="rpt2_ctl00_slc" 
                                                                    border="0" cellpadding="5">
                                                                    <tbody>
                                                                        <tr>
			<td class='<%# "m"+ Container.ItemIndex + 21  %>'>
                <asp:CheckBox ID="cboA" runat="server" Text="A" />
                                                                                <asp:CheckBox ID="cboB" runat="server" Text="B" />
                                                                                <asp:CheckBox ID="cboC" runat="server" Text="C" />
                                                                                <asp:CheckBox ID="cboD" runat="server" Text="D" />
                                    
                    </td>
		</tr>
	</tbody>
                                                </table>
                                                </div>
                                            </td>
                                            <td align="left">
                                                <div class="bjArea">
                                                    <asp:HiddenField ID="hfmark" runat="server" Value='<%# "m"+Container.ItemIndex + 1  %>' />
                                                    <asp:Button ID="btnMark" runat="server" Text="标  记" CssClass="bjst" />
                                                </div>
                                            </td>
                                        </tr>
                                                </tbody>
                                            </table>
                                </div>
                                    </asp:Panel>
                            </div>                        
                    </ItemTemplate>
                </asp:DataList>
                    <div class="noteArea">
                            第三部分：<span id="lbType3">是非题</span> （共<span id="lbTotal3"><asp:Label ID="lbljsum" runat="server"></asp:Label></span>道题，每题<span id="lbFs3"><asp:Label ID="lbljfen" runat="server"></asp:Label></span>分）

                    </div>
                        <asp:DataList ID="DataList3" runat="server" CssClass="topM" OnItemDataBound="DataList1_ItemDataBound">
                    <ItemTemplate>
                        <div class="questionArea" id="div21">
                                    <a name="q<%#Container.ItemIndex + 1 %>" class="jjump"></a><span id="rpt3_ctl00_lbContent">
                                    <table>
                                        <tbody>
                                            <tr>
                                                    <td class="cTiHao">
                                                        <span class="jtihao"><%#Container.ItemIndex + 1 %></span>、
                                                    </td>
                                                <td class="cTi">
                                                    <div class="3DSection1">
                                                            <asp:Label ID="lbl_title" runat="server" Text='<%# Bind("jtitle") %>'></asp:Label>
                                                            <asp:Label ID="lbl_judgeId" runat="server" Text='<%# Bind("judgeId") %>' Visible="False"></asp:Label><br /><br />
                                                            A.正确 B.错误<br /><br />                                                       
                                                    </div>
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table> 
                            </span>                            
                                <asp:Panel ID="Pd" runat="server">
                                <div class="noteArea2">
                                    <div class="markArea" style="display: none;">
                                    </div>
                                    <table>
                                                <tbody>
                                                    <tr>
                                            <td>
                                                <b>选择答案：</b>
                                            </td>
                                            <td width="300">
                                                <div class="resultArea">
                                                                <table id="rpt3_ctl00_slc" 
                                                                    border="0" cellpadding="5">
                                                                    <tbody>
                                                                        <tr>
			<td class='<%# "j"+ Container.ItemIndex + 1  %>'>
                                                                                <asp:RadioButton ID="rdoYes" runat="server" GroupName="rdo" Text="正确" />
                                                                                ；<asp:RadioButton ID="rdoNo" runat="server" Text="错误" GroupName="rdo" /><br />
                                    
                                                                                                                                       </td>
		</tr>
                                                                    </tbody>
                                                                </table>
    											</div>
                                            </td>
                                            <td align="left">
                                                <div class="bjArea">
                                                    <asp:HiddenField ID="hfmark" runat="server" Value='<%# "j"+ Container.ItemIndex + 1  %>' />
                                                    <asp:Button ID="btnMark" runat="server" Text="标  记" CssClass="bjst" />
                                                </div>
                                            </td>
                                        </tr>
                                                </tbody>
                                            </table>
                                </div>
                                    </asp:Panel>
                            </div>                      
                    </ItemTemplate>
                </asp:DataList>
             <div class="noteArea">
                                第四部分：<span id="Span1">简答题</span> （共<span id="lbTotal4"><asp:Label ID="lblasum" runat="server"></asp:Label></span>道题，每题<span id="lbFs4"><asp:Label ID="lblafen" runat="server"></asp:Label></span>分）
                            </div>
                            <asp:DataList ID="DataList4" runat="server" CssClass="topM" OnItemDataBound="DataList1_ItemDataBound">
                                <ItemTemplate>
                                    <div class="questionArea" id="div21">
                                        <a name="q<%#Container.ItemIndex + 1 %>" class="ajump"></a><span id="rpt3_ctl00_lbContent">
                                            <table>
                                                <tbody>
                                                    <tr>
                                                        <td class="cTiHao">
                                                            <span class="atihao"><%#Container.ItemIndex + 1 %></span>、
                                                        </td>
                                                        <td class="cTi">
                                                            <div class="3DSection1">
                                                                <asp:Label ID="lbl_title" runat="server" Text='<%# Bind("ainfo") %>'></asp:Label>
                                                                <asp:Label ID="lbl_judgeId" runat="server" Text='<%# Bind("aid") %>' Visible="False"></asp:Label><br />
                                                                
                                                            </div>
                                                        </td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </span>
                                        <asp:Panel ID="Pz" runat="server" Visible="false">
                                            <div class="noteArea">
                                                标准答案：<asp:Label ID="lblr" runat="server" Text='<%# Eval("akey") %>'></asp:Label>
                                                
                                            </div>
                                        </asp:Panel>                                        
                                    </div>
                                </ItemTemplate>
                            </asp:DataList> 
            
              <div style="text-align: center; margin-top: 15px; margin-bottom: 15px;">
            <asp:Button ID="btnOK" runat="server" Text="交卷" OnClick="btnSub_Click" OnClientClick="ccookie();" />
            <asp:Button ID="btnjj" runat="server" OnClick="btnOK_Click" Text="Button" OnClientClick="ccookie();" Style="display: none;" />
            <br />
            <br />
        </div>
</div>
        
        
        
       
     <%--<div id="p" class="easyui-panel" style="width:500px;height:200px;padding:10px;"   
        title="未做题" iconCls="icon-save" collapsible="true">   
    <div id="s">
        <h1>单选题</h1>
    </div>          
</div>--%>  
        <asp:Panel ID="pr" runat="server" style="background-color: white; width:990px; margin:0 auto;">
            <tr>
            <td valign="top" style="padding: 6px; background-color: white;">                
                <div id="plCheck" style="display: none;padding: 6px; background-color: white;" >
                    <div align="center" style="margin: 10px;">
                        <span class="warnInfo" id="lbWarn">您还有<asp:Label ID="lblna" runat="server" Text=""></asp:Label>道题未答，确认提交答卷吗？</span></div>
                    <div align="center"> 
                                <asp:Button ID="btnOK1" class="systemButton" OnClientClick="Javascript: return validateSubmit();"
                                    runat="server" Text="确认提交" OnClick="btnOK_Click" />
                        <input class="systemButton" onclick="clickBack()" type="button" value="返回试卷">
                    </div>
                    <div align="left" style="padding-left: 20px;">
                        <div class="asd">
                            &nbsp;<span id="lbAsd">（<asp:Label ID="lblask" runat="server" Text=""></asp:Label>道）</span></div>
                                <table id="tblAsd" style="border-collapse: collapse;" border="0" cellspacing="0"
                                    cellpadding="0">
<asp:Literal ID="lask" runat="server"></asp:Literal>
	</table>
                        <div class="nasd">
                            &nbsp;<span id="lbNasd">（<asp:Label ID="lblnoask" runat="server" Text=""></asp:Label>道）</span></div>
                                <table id="tblNasd" style="border-collapse: collapse;" border="0" cellspacing="0"
                                    cellpadding="0">
		<asp:Literal ID="lnoask" runat="server"></asp:Literal>
                        </table>
                        <div class="ckd">
                            &nbsp;<span id="lbCkd">（<asp:Label ID="lblmark" runat="server" Text=""></asp:Label>道）</span></div>
                                <table id="tblCkd" style="border-collapse: collapse;" border="0" cellspacing="0"
                                    cellpadding="0">
<asp:Literal ID="lmark" runat="server"></asp:Literal>
	</table>
                    </div>
</div>
            </td>
        </tr>
                </asp:Panel><asp:HiddenField ID="hfid" runat="server" />
        <asp:HiddenField ID="hftime" runat="server" />
    </form>
</body>
</html>
